package com.itheima.mapper;

import com.itheima.pojo.Clazz;
import com.itheima.pojo.ClazzQueryParam;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ClazzMapper {

    @Insert("insert into clazz(name,room,begin_date,end_date,master_id,subject,create_time,update_time)" +
            "values (#{name},#{room},#{beginDate},#{endDate},#{masterId},#{subject},#{createTime},#{updateTime})")
    void addClazz(Clazz clazz);

    List<Clazz> selectPage(ClazzQueryParam clazzQueryParam);

    @Select("select *from clazz")
    List<Clazz> selectClazzAll();
    @Delete("delete from clazz where id =#{id}")
    void deleteClazzById(Integer id);
    @Select("select *from clazz where id =#{id}")
    Clazz selectClazzById(Integer id);
    @Update("update clazz set name=#{name},room=#{room},begin_date=#{beginDate},subject=#{subject},master_id=#{masterId},update_time=#{updateTime} where id =#{id}")
    void updateClazz(Clazz clazz);
}
